package com.example.instantmessage.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

//没用

public class MessageInfoAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private List<String> name;

    public MessageInfoAdapter(@NonNull FragmentManager fm, int behavior, List<Fragment> fragments, List<String> name) {//???
        super(fm, behavior);
        this.fragments = fragments;
        this.name = name;
    }
    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    public String getPageTitle(int positon){
        return name.get(positon);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
